#include <iostream>
#include <cassert>
#include <vector>
#include <cstdio>

const int N = 2e7 + 5;
const int M = 1e5 + 5;
const int P = 998244353;

int n, m;
int fac[N], ifac[N];
int pre[N], pw[N];
bool vis[N];
//int res[N];

int qpow(int x, int p) {
	int res = 1, base = x;
	while(p) {
		if(p & 1) res = 1ll * res * base % P;
		base = 1ll * base * base % P;
		p >>= 1;
	}
	return res;
}

inline int cob(int n, int m) {
	return 1ll * fac[n] * ifac[m] % P * ifac[n-m] % P;
}

int main() {
	std::freopen("drama.in", "r", stdin);
	std::freopen("drama.out", "w", stdout);
	std::cin >> n >> m;
	fac[0] = ifac[0] = fac[1] = ifac[1] = 1;
	for(int i = 2; i <= n; ++i) fac[i] = 1ll * fac[i-1] * i % P;
	ifac[n] = qpow(fac[n], P - 2);
	for(int i = n - 1; i >= 2; --i) ifac[i] = 1ll * ifac[i+1] * (i+1) % P;
	pw[0] = 0, pw[1] = 1;
	std::vector<int> prime;
	for(int i = 2; i <= n; ++i) {
		if(!vis[i]) {
			pw[i] = qpow(i, m);
			prime.push_back(i);
		}
		for(int p : prime) {
			if(i * p > n) break;
			vis[i * p] = 1;
			pw[i * p] = 1ll * pw[i] * pw[p] % P;
			if(i % p == 0) break;
		}
	}
	for(int i = 0; i <= n; ++i) {
		if(i) pre[i] = pre[i-1];
		pre[i] = (pre[i] + 1ll * ifac[i] * pw[i]) % P;
	}
	int ans = 0;
	for(int j = 0; j <= n; ++j) {
		ans = (ans + (j % 2 ? -1ll : 1ll) * ifac[j] * pre[n-j]) % P;
	}
	std::cout << (ans + P) % P << "\n";
	return 0;
}
